#include<bits/stdc++.h>
using namespace std;
int n;
bool f,sol1=1;
int a[100100];
int b[100100];
int main()
{
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]>2)sol1=0;
    }
    if(sol1){
        for(int i=1;i<=n;i++){
            b[a[i]]++;
        }
        if(b[1]>b[2]){
            cout<<b[1]<<endl;
        }
        else cout<<b[2]<<endl;
        return 0;
    }
    sort(a+1,a+1+n);
    int k=1;
    b[k]=a[1];
    for(int i=2;i<=n;i++){
        f=0;
        for(int j=1;j<=k;j++){
            if(a[i]>b[j]){
                b[j]=a[i];
                f=1;
                break;
            }
        }
        if(f==0){
            k++;
            b[k]=a[i];
        }
    }
    cout<<k<<endl;
    return 0;
}

